Pseudo Wire Load Sharing Method and Device

ABSTRACT

This application provides a pseudo wire load sharing method and apparatus, applied to a scenario in which a first provider edge PE device is separately connected to at least one second PE device by using at least two PWs. The method comprises receiving, by the first PE device, a data flow from a customer edge CE device, and forwarding the data flow to a PW trunk interface, where the PW trunk interface is associated with at least two active PWs; and performing, by the first PE device, load sharing processing on the data flow, and forwarding the data flow by using the at least two active PWs. This is beneficial to transmission of large data traffic by using the PW.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2016/101320, filed on Sep. 30, 2016, the disclosure of which ishereby incorporated by reference in its entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the communicationsfield, and in particular, to a pseudo wire load sharing method anddevice.

BACKGROUND

Pseudo wire emulation edge-to-edge (PWE3) refers to a layer 2 servicecarrying technology used to simulate, as truly as possible in a packetswitched network (PSN), basic behavior and basic features of servicessuch as asynchronous transfer mode (ATM), frame relay (FR), Ethernet,and low speed time division multiplexing (TDM) circuit.

Multiprotocol Label Switching (MPLS) PWE3 is an important technology ina metropolitan area network. With the MPLS PWE3 technology, an originalaccess manner (such as an ATM and an FR) and an existing IP backbonenetwork can be well converged in order to reduce network reconstructionand operation expenses. With the MPLS PWE3 technology, the IP backbonenetwork may access various access networks in order to transform andenhance an original data network. After an MPLS backbone network isconstructed, a conventional data communications network ATM/FR or thelike may be configured as an access network closer to a user, but anATM/FR user cannot sense a change of a network structure.

A virtual circuit or a pseudo wire (PW) provided by the MPLS PWE3 hasbeen widely deployed in provider networks. However, a current technologycannot support PW load sharing, and the PW cannot be used to performload sharing transmission on a data flow.

SUMMARY

Embodiments of the present disclosure provide a PW load sharing methodand device in order to resolve a problem that a PW does not support loadsharing, and the PW cannot be effectively used to transmit large datatraffic.

To resolve the foregoing problem, a first aspect of the embodiments ofthe present disclosure provides a PW load sharing method, applied to ascenario in which a first provider edge PE device is separatelyconnected to at least one second PE device by using at least two PWs,where the method comprises receiving, by the first PE device, a dataflow from a customer edge CE device, and forwarding the data flow to aPW trunk interface, where the PW trunk interface is associated with atleast two active PWs; and performing, by the first PE device, loadsharing processing on the data flow, and forwarding the data flow byusing the at least two active PWs.

The PW trunk interface is associated with the at least two active PWs,and in this way, this embodiment of the present disclosure provides theload sharing forwarding method for the data flow in order to increase abandwidth and a throughput for transmitting the data flow by using thePW.

In a first possible implementation of the first aspect, before theforwarding the data flow to a PW trunk interface, the method furthercomprises creating, by the first PE device, the PW trunk interface, andassociating the PW trunk interface with the at least two PWs; anddetermining, by the first PE device from the at least two PWs, at leasttwo PWs as active PWs.

With reference to the first aspect or the first possible implementationof the first aspect, in a second possible implementation of the firstaspect, the determining, by the first PE device from the at least twoPWs, at least two PWs as active PWs comprises obtaining, by the first PEdevice, an active PW quantity parameter, where the active PW quantityparameter represents a quantity of PWs in an active state, and is apositive integer greater than or equal to 2; and determining at leasttwo active PWs from the at least two PWs according to the active PWquantity parameter.

In this embodiment of the present disclosure, by configuring the activePW quantity parameter, a user (for example, a network administrator or auser of a third party application) may plan a load sharing PW accordingto a requirement of the user in order to improve flexibility of PW loadsharing deployment.

When the active PW quantity parameter is set to be equal to a quantityof PWs associated with the PW trunk interface, it indicates all-activeload sharing deployment. In this case, a bandwidth of the PW can be usedto a greatest extent, and bandwidths of all PWs are combined to providea greatest bandwidth guarantee. When the active PW quantity parameter isset to be less than the quantity of PWs associated with the PW trunkinterface, and is greater than 1, it indicates multi-active load sharingdeployment. In this case, backup protection is added for a primary loadsharing PW. When one or more primary PWs are faulty, it may be ensuredthat forwarding is not interrupted, a bandwidth provided by the PW isnot decreased, and a service is not affected, and this improvesreliability of PW load sharing.

With reference to the first aspect or the second possible implementationof the first aspect, in a third possible implementation of the firstaspect, the obtaining, by the first PE device, an active PW quantityparameter comprises configuring, by the first PE device, the active PWquantity parameter on the first PE device according to a configurationcommand; or receiving, by the first PE device, a message sent by acontrol and management device, and obtaining the active PW quantityparameter from the message; or generating, by the first PE device, theactive PW quantity parameter by running an algorithm; or setting adefault value of the active PW quantity parameter during softwareimplementation of the first PE device.

With reference to any one of the first aspect, or the second to thethird possible implementations of the first aspect, in a fourth possibleimplementation of the first aspect, the determining at least two activePWs from the at least two PWs according to the active PW quantityparameter comprises obtaining, by the first PE device, a priority ofeach PW in the at least two PWs, and determining at least two PWs asactive PWs according to the priority of each PW in the at least two PWsand the active PW quantity parameter.

In this embodiment of the present disclosure, by setting the priority ofeach PW, the user (for example, a network administrator or a user of athird party application) may more flexibly plan a load sharing PWaccording to a requirement of the user in order to further improveflexibility of PW load sharing deployment.

With reference to the first aspect or the fourth possible implementationof the first aspect, in a fifth possible implementation of the firstaspect, the determining at least two PWs as active PWs according to thepriority of each PW in the at least two PWs and the active PW quantityparameter comprises obtaining, by the first PE device, the priority ofeach PW in the at least two PWs, and determining, from the at least twoPWs, at least two PWs with higher priority ranks as active PWs accordingto a descending order of the priorities of the PWs and the active PWquantity parameter, where the priority of the PW is used to indicateprecedence in using the PW as an active PW.

With reference to any one of the first aspect, or the second to thethird possible implementations of the first aspect, in a sixth possibleimplementation of the first aspect, the determining at least two activePWs from the at least two PWs according to the active PW quantityparameter comprises obtaining, by the first PE device, an IP address ofa peer second PE of each PW in the at least two PWs, and determining atleast two PWs as active PWs according to the IP address of the peersecond PE of each PW in the at least two PWs and the active PW quantityparameter.

The load sharing PW is selected according to an IP address of a peer PEdevice of each PW, and in this way, this embodiment of the presentdisclosure provides a PW load sharing method that is simple and easy toperform without a need of an extra setting.

With reference to the first aspect or the sixth possible implementationof the first aspect, in a seventh possible implementation of the firstaspect, the determining at least two PWs as active PWs according to theIP address of the peer second PE of each PW in the at least two PWs andthe active PW quantity parameter comprises obtaining, by the first PEdevice, the IP address of the peer second PE of each PW in the at leasttwo PWs, and determining, from the at least two PWs, at least two PWswith higher IP address ranks as active PWs according to a descendingorder of the IP addresses of the peer second PEs of the PWs and theactive PW quantity parameter; or obtaining, by the first PE device, theIP address of the peer second PE of each PW in the at least two PWs, anddetermining, from the at least two PWs, at least two PWs with higher IPaddress ranks as active PWs according to an ascending order of the IPaddresses of the peer second PEs of the PWs and the active PW quantityparameter.

With reference to any one of the first aspect, or the second to thethird possible implementations of the first aspect, in an eighthpossible implementation of the first aspect, the determining at leasttwo active PWs from the at least two PWs according to the active PWquantity parameter comprises obtaining, by the first PE device, apriority of each PW in the at least two PWs and an IP address of a peersecond PE of each PW in the at least two PWs, and determining at leasttwo PWs as active PWs according to the priority of each PW in the atleast two PWs, the IP address of the peer second PE of each PW in the atleast two PWs, and the active PW quantity parameter.

In this embodiment of the present disclosure, by using the method inwhich the priority and the IP address are combined, a problem that aload sharing PW cannot be determined according to the PW priority isresolved, and a solution in which a load sharing PW is preferablydetermined is provided, and this further improves accuracy andflexibility of PW load sharing deployment.

With reference to any one of the first aspect, or the first to theeighth possible implementations of the first aspect, in a ninth possibleimplementation of the first aspect, the receiving, by the first PEdevice, a data flow from a CE device, and forwarding the data flow to aPW trunk interface comprises receiving, by the first PE device, the dataflow from the CE device through an attachment circuit AC interface, andforwarding the data flow to the PW trunk interface according to anassociation relationship between the AC interface and the PW trunkinterface; or receiving, by the first PE device, the data flow from theCE device through an attachment circuit AC interface, forwarding thedata flow to a virtual switch instance VSI, searching a MAC forwardingtable in the VSI to obtain the PW trunk interface, and forwarding thedata flow to the PW trunk interface.

With reference to any one of the first aspect, or the first to the ninthpossible implementations of the first aspect, in a tenth possibleimplementation of the first aspect, the first PE device performs, basedon a configured hash gene, cyclic redundancy check on the data flow toobtain a check value, performs a modulo operation according to a loadsharing PW quantity value by using the check value to obtain aremainder, uses the remainder as a key value, then uses the key value asan index to search a PW trunk forwarding table in order to match anactive PW for performing load sharing processing, and forwards the dataflow by using the at least two active PWs.

By identifying a packet eigenvalue (hash gene) carried in the data flow,per-flow PW load sharing forwarding is implemented by using a hashalgorithm, and this obtains a better service flow order preservingeffect.

With reference to any one of the first aspect, or the first to the ninthpossible implementations of the first aspect, in an eleventh possibleimplementation of the first aspect, the first PE device determines,according to a value obtained by a counter by counting each data packetin the data flow, an active PW to perform load sharing forwarding.

By selecting the active PW according to the count value of each datapacket, per-packet PW load sharing is implemented, and this obtainsrelatively high forwarding efficiency.

According to a second aspect, the present disclosure provides a first PEdevice, and the first PE device is configured to execute the method inany one of the first aspect or the possible implementations of the firstaspect. In an embodiment, the first PE device comprises a moduleconfigured to execute the method in any one of the first aspect or thepossible implementations of the first aspect.

According to a third aspect, the present disclosure provides a first PEdevice, and the first PE device comprises a receiver, a processor, atransmitter, a random access memory, a read-only memory, and a bus. Theprocessor is separately coupled to the receiver, the transmitter, therandom access memory, and the read-only memory by using the bus. Whenthe first PE device needs to be run, a basic input/output system or abootloader in an embedded system that is built into the read-only memoryis used to lead a system to start, and lead the first PE device to entera normal running state. After entering the normal running state, thefirst PE device runs an application program and an operating system inthe random access memory such that the processor executes the method inany one of the first aspect or the possible implementations of the firstaspect.

According to a fourth aspect, the present disclosure provides a computerreadable medium, configured to store a computer program, where thecomputer program comprises an instruction used to execute the method inany one of the first aspect or the possible implementations of the firstaspect.

According to a fifth aspect, a first PE device is provided, and thefirst PE device comprises a main control board and an interface board,and may further include a switching board. The first PE device isconfigured to execute the method in any one of the first aspect or thepossible implementations of the first aspect. In an embodiment, thefirst PE device comprises a module configured to execute the method inany one of the first aspect or the possible implementations of the firstaspect.

According to a sixth aspect, a first PE device is provided, and thefirst PE device comprises an interface board, and may further include aswitching board. The first PE device is configured to execute functionsof the interface board in the fifth aspect, and may further executefunctions of the switching board in the fifth aspect.

According to a seventh aspect, a controller is provided, and thecontroller comprises a receiver, a processor, a transmitter, a randomaccess memory, a read-only memory, and a bus. The processor isseparately coupled to the receiver, the transmitter, the random accessmemory, and the read-only memory by using the bus. When the controllerneeds to be run, a basic input/output system or a bootloader in anembedded system that is built into the read-only memory is used to leada system to start, and lead the controller to enter a normal runningstate. After entering the normal running state, the controller runs anapplication program and an operating system in the random access memorysuch that the processor executes functions of the main control board inthe fifth aspect.

In the present disclosure, a PE device creates a PW trunk interface, andthe PW trunk interface is associated with at least two active PWs. Whenreceiving a data flow from a CE device, the PE device leads the dataflow to the PW trunk interface in order to perform load sharingforwarding by using the at least two active PWs associated with the PWtrunk interface such that the PW can be effectively used to transmitlarge data traffic. Therefore, this increases a bandwidth and athroughput, enhances a data processing capability of the PE device, andimproves PW deployment flexibility.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentdisclosure more clearly, the following briefly describes theaccompanying drawings required for describing the embodiments. Theaccompanying drawings in the following description merely show someembodiments of the present disclosure, and a person of ordinary skill inthe art can derive other implementations from these accompanyingdrawings without creative efforts. In addition, all these embodiments orimplementations fall within the protection scope of the presentdisclosure.

FIG. 1 is a schematic diagram of an application background of thepresent disclosure;

FIG. 2A is a schematic diagram of a possible application scenario of thepresent disclosure;

FIG. 2B is a schematic diagram of another possible application scenarioof the present disclosure;

FIG. 2C is a schematic diagram of still another possible applicationscenario of the present disclosure;

FIG. 2D is a schematic diagram of yet another possible applicationscenario of the present disclosure;

FIG. 3 is a schematic diagram of a PW load sharing forwarding procedureaccording to an embodiment of the present disclosure;

FIG. 4A is a schematic diagram of a forwarding procedure according to anembodiment of the present disclosure;

FIG. 4B is a schematic diagram of another forwarding procedure accordingto an embodiment of the present disclosure;

FIG. 5A is a schematic structural diagram of a first PE device accordingto an embodiment of the present disclosure;

FIG. 5B is a schematic structural diagram of another first PE device anda controller according to an embodiment of the present disclosure;

FIG. 6 is a schematic structural diagram of still another first PEdevice according to an embodiment of the present disclosure; and

FIG. 7 is a schematic structural diagram of yet another first PE deviceaccording to an embodiment of the present disclosure.

DESCRIPTION OF EMBODIMENTS

The technical solutions according to embodiments of the presentdisclosure are clearly described in the following with reference to theaccompanying drawings. The described embodiments are merely some but notall of the embodiments of the present disclosure. All other embodimentsobtained by a person of ordinary skill in the art based on theembodiments of the present disclosure without creative efforts shallfall within the protection scope of the present disclosure.

A network architecture and a service scenario described in theembodiments of the present disclosure are intended to describe thetechnical solutions in the embodiments of the present disclosure moreclearly, but are not construed as a limitation on the technicalsolutions provided in the embodiments of the present disclosure. Aperson of ordinary skill in the art may understand that, with evolutionof the network architecture and emergence of a new service scenario, thetechnical solutions provided in the embodiments of the presentdisclosure are also applicable to a similar technical problem.

The technical solutions described in the present disclosure may beapplied to a network constructed based on an MPLS PWE3 technology. ForPWE3, the Label Distribution Protocol (LDP) or the like is used as asignaling protocol, various layer 2 services (for example, various layer2 data packets) on a customer edge (CE) end are carried on a tunnel (forexample, an MPLS LSP tunnel, a TE tunnel, or a GRE tunnel), and layer 2data on the CE end is transparently transmitted. As shown in FIG. 1,basic transmission components of a PWE3 network comprises an attachmentcircuit (AC), a PW, a forwarder, a tunnel, and a PW signaling protocol.A packet flow direction in a virtual private network (VPN) 1 from a CE1to a CE3 is used as an example to describe a basic flow direction of adata flow, and the basic flow direction of the data flow is as follows:The CE1 sends a layer 2 packet, and is connected to a provider edge (PE)1 by using an AC; after the PE1 receives the packet, a forwarder of thePE1 selects a PW to forward the packet; the PE1 then generates twolayers of MPLS labels according to a forwarding table entry of the PW,where an inner layer label (that is, a private network label) is used toidentify the PW, and an outer layer label (that is, a public networklabel) is used to pass through a tunnel to reach a PE2; and the layer 2packet reaches the PE2 after passing through a tunnel of a publicnetwork, a system removes the private network label, and a forwarder ofthe PE2 selects an AC to forward the packet in order to forward thelayer 2 packet to the CE3.

It should be noted that, the PW may be referred to as a pseudo wire, ormay be referred to as a virtual circuit. With reference to a specificdeployment scenario, the forwarder may be deployed on a device such as aPE, an underlayer PE (UPE), or a superstratum PE (SPE). In ahierarchical deployment scenario, PE devices are classified into twotypes: a UPE and an SPE. The UPE is an aggregation device of a user,that is, a device directly connected to the CE; the UPE is also referredto as a user-side PE. The SPE is a device that is connected to the UPEand that is located in the network, and is also referred to as a switchPE, and a meaning of the switch PE may be understood by a person skilledin the art. The PE and the PE device have a same meaning in theembodiments of the present disclosure, and may be interchanged.Likewise, the CE and the CE device may be interchanged, and P and a Pdevice may be interchanged.

It should be further noted that, the CE device, the PE device, and the Pdevice may be routers or switches. Usually, one side of the CE device isconnected to the PE or the UPE device, and the other side is connectedto user equipment (UE) such that user equipment traffic is forwarded andthe user equipment accesses a provider network. The UE may includevarious devices that have a wireless communications function, such as ahandheld device, an in-vehicle device, a wearable device, a computerdevice, or another processing device connected to a wireless modem, andvarious forms of user equipment, such as a mobile station (MS), aterminal, and terminal equipment (TE). For ease of description, in thisapplication, the devices mentioned above are collectively referred to asuser equipment or UE.

Although the PW provided in the MPLS PWE3 is widely applied to thenetwork to provide a VPN service and carry a data flow, the PW does notsupport load sharing, and the PW cannot be effectively used to transmitlarge data traffic.

Therefore, the embodiments of the present disclosure provide a PW loadsharing method and apparatus. A PE device creates a PW trunk interface,and the PW trunk interface is associated with at least two active PWs.When receiving a data flow from a CE device, the PE device leads thedata flow to the PW trunk interface in order to perform load sharingforwarding by using the at least two active PWs associated with the PWtrunk interface such that the PW can be effectively used to transmitlarge data traffic. It should be noted that, in some hierarchicalnetworking scenarios, the PE device may be a UPE device, and thefollowing describes this in detail.

For different application requirements and different network designrequirements, the MPLS PWE3 may be deployed in different networkapplication scenarios, for example, a typical PWE3 layer 2 virtualprivate network (L2VPN) scenario, and a scenario in which the PWaccesses an Ethernet virtual private network (EVPN). With reference tothe technical solutions of the present disclosure, the following furtherseparately describes the application scenarios of the present disclosurein detail.

FIG. 2a shows an application scenario of a PWE3 L2VPN according to anembodiment of the present disclosure. In this typical PWE3single-segment networking application, a backbone network is anMPLS/Internet Protocol (IP) network, and manners for accessing localarea networks are different. For example, a provider establishes anationwide backbone network, and provides a PWE3 service, and customersare separately distributed in Beijing (for example, Site1) and Shanghai(for example, Site2). The Beijing segment accesses the backbone networkof the provider in an ATM manner, and the Shanghai counterpart accessesthe backbone network of the provider in an FR manner. The provider mayestablish a PWE3 connection between two access points: a PE1 in Beijingand a PE2 in Shanghai, that is, a PW connection. When data trafficbetween the Beijing segment and the Shanghai segment continues toincrease, the customer expects that the PW can provide a bandwidth of100 M to carry the data traffic between the two areas. However, in thiscase, there are only one tunnel 1 with a bandwidth of 40 M and anothertunnel 2 with a bandwidth of 60 M between the two areas, neither thebandwidth of the tunnel 1 nor the bandwidth of the tunnel 2 reaches 100M, and the tunnel 1 or the tunnel 2 cannot carry the PW with a bandwidthof 100 M. Therefore, in some approaches, a customer requirement cannotbe met.

In the present disclosure, a PW trunk interface 1 is created on the PE1,a PW trunk interface 2 is created on the PE2, the PW trunk interface 1is associated with a PW1 and a PW2, and the PW trunk interface 2 is alsoassociated with the PW1 and the PW2. The PW1 is carried on the tunnel 1with a bandwidth of 40 M, and a path of the tunnel 1 is PE1->PE2. ThePW2 is carried on the tunnel 2 with a bandwidth of 60 M, a path of thetunnel 2 is PE1->P1->PE2, and the P1 is a provider (P) device. The PW1is associated with the PW2 by using the PW trunk interface, and the twoPWs provide a bandwidth of 100 M together in a load sharing forwardingmanner in order to meet the customer requirement. When receiving a dataflow from a CE1, the PE1 leads the data flow to the PW trunk interfacesuch that the PW1 and the PW2 that are associated by using the PW trunkinterface perform load sharing forwarding. After the bandwidth of thePW1 and the bandwidth of the PW2 are combined, the customer requirementfor a bandwidth of 100 M is met.

It should be noted that, according to whether source nodes on ends ofdeployed PWs are the same and destination nodes on the other ends of thedeployed PWs are the same, FIG. 2a belongs to a deployment scenario inwhich source nodes are the same and destination nodes are the same, thatis, the PW1 and the PW2 have the same source node PE1 and the samedestination node PE2. In addition, in different scenarios, the tunnel 1carrying the PW1 and the tunnel 2 carrying the PW2 may pass through asame path PE1->PE2, or a path of the tunnel 1 may be PE1->PE2, and apath of the tunnel 2 is PE1->middle P->PE2. The middle P is between thePE1 and the PE2, may be one P device, or may be multiple P devices, andvaries with actual network deployment. It should be further noted that,for brevity of an accompanying drawing, in the accompanying drawing ofthe embodiments of the present disclosure, a tunnel carrying a PW is notdepicted, and this may be understood by a person skilled in the art.

FIG. 2b shows an application scenario in which a PW accesses an EVPNaccording to an embodiment of the present disclosure. The EVPN is asolution that provides an Ethernet multipoint service in an MPLS networkand that is of a next generation of Ethernet layer 2 virtual privatenetwork L2VPN, and is used as a mainstream solution in network designsof major providers to carry a layer 2 service. In the EVPN, MAC learningbetween PEs is implemented in a control plane; and for a controlprotocol, the Border Gateway Protocol (BGP) is used as a protocol of thecontrol plane in order to perform Media Access Control (MAC) addresslearning, access topology, and VPN endpoint discovery.

Currently, in the Internet Protocol (IP)/MPLS network, a PW is used toaccess the EPVN, and an end-to-end bearer is implemented based on anMPLS technology, thereby implementing end-to-end EVPN deployment in aprovider network. One of important advantages of the EVPN solution isimplementing multihoming multi-active access of a client device.However, currently, in a solution in which an EVPN is accessed by usinga virtual leased line (VLL) and a virtual private LAN service (VPLS)based on the PW technology, as shown in FIG. 2b , a UPE1 is connected toan SPE2-1, an SPE2-2, an SPE2-3, and an SPE2-4 by using four PWs inorder to implement primary/secondary PW redundancy protection andimprove service reliability. However, the PW does not support loadsharing, an advantage of the EVPN of supporting multihoming multi-activeaccess of the client device cannot be effectively exerted, and themultihoming PW cannot be used to provide a transmission capability of alarger bandwidth.

In the present disclosure, a PW trunk interface is created on the UPE1,and the PW trunk interface is associated with a PW1, a PW2, a PW3, and aPW4. The PW1 is carried on a tunnel 1, the PW2 is carried on a tunnel 2,the PW3 is carried on a tunnel 3, and the PW4 is carried on a tunnel 4.The PW trunk interface is associated with the PW1, the PW2, the PW3, andthe PW4, where two PWs, the PW1 and the PW2, serve as active PWs toperform load sharing forwarding, and the PW3 and the PW4 serve asnon-active PWs and are used as backup PWs for the active PWs. The twoactive PWs, the PW1 and the PW2, are used to perform load sharingforwarding, and the PW1 and the PW2 are combined to provide atransmission capability of a larger bandwidth in order to sufficientlyexert the advantage of the EVPN of supporting multihoming multi-activeaccess of the client device.

The foregoing describes a multi-active PW deployment manner (as shown inFIG. 2b , some of the four PWs are in an active state, and the other arein a non-active state), or there may be an all-active PW deploymentmanner (as shown in FIG. 2c , both two PWs are in the active state, andthere is no backup PW). As shown in FIG. 2c , the UPE1 is connected tothe SPE2-1 and the SPE2-2 by using the two PWs, the PW1 is carried onthe tunnel 1, and the PW2 is carried on the tunnel 2. In the presentdisclosure, a PW trunk interface is created on the UPE1, the PW trunkinterface is associated with the PW1 and the PW2, the PW1 and the PW2serve as two active PWs to perform load sharing forwarding, and the twoPWs are combined to provide a transmission capability of a largerbandwidth.

It should be noted that, according to whether source nodes on ends ofdeployed PWs are the same and destination nodes on the other ends of thedeployed PWs are the same, FIG. 2b and FIG. 2c belong to a deploymentscenario in which source nodes are the same but destination nodes aredifferent. That is, as shown in FIG. 2b , the PW1, the PW2, the PW3, andthe PW4 have the same source node PE1 and different destination nodes:the SPE2-1, the SPE2-2, the SPE2-3, and the SPE2-4. For another example,in FIG. 2c , the PW1 and the PW2 have the same source node UPE1 anddifferent destination nodes: the SPE2-1 and the SPE2-2 (or may bereferred to as a PE2-1 and a PE2-2). For brief and clear description,two or four load sharing PWs are mainly used as examples for descriptionin the foregoing application scenarios. In actual application, aquantity of load sharing PWs may be at least two, for example, three,five, or six. The multiple load sharing PWs may be carried on onetunnel, or may be respectively carried on multiple different tunnels.Paths passed through by the multiple different tunnels may be the same,or may be different, and this is not limited in the present disclosure.In addition, the active PW mentioned in the present disclosure indicatesthat a state of the PW is active, and an active state means that the PWcan be used to carry or forward a data flow. In a primary/secondaryprotection scenario, the active PW is usually used as a primary PW.Correspondingly, the state of the PW may be non-active, and thenon-active state means that the PW cannot be used to carry or forward adata flow, and is usually used as a secondary PW. When the primary PW isfaulty, the PW is switched to the secondary PW.

The foregoing describes several possible application scenarios relatedto the present disclosure, and based on this, the following furtherdescribes the embodiments of the present disclosure in detail.

FIG. 3 is a schematic flowchart of a PW load sharing method according toan embodiment of the present disclosure. The method is applied tonetworking in which a first PE device is connected to one or more secondPE devices by using at least two PWs.

In an example, as shown in FIG. 2a , a first PE device (PE1) isconnected to one second PE device (PE2) by using at least two PWs (a PW1and a PW2).

In another example, as shown in FIG. 2b , a first PE device (UPE1) isconnected to four second PE devices (an SPE2-1, an SPE2-2, an SPE2-3,and an SPE2-4) by using at least two PWs (a PW1, a PW2, a PW3, and aPW4).

In still another example, as shown in FIG. 2c , a first PE device (UPE1)is connected to two second PE devices (an SPE2-1 and an SPE2-2) by usingat least two PWs (a PW1 and a PW2).

It should be noted that, in different PW deployment scenarios, the firstPE device may be a PE device, or may be a UPE device; and the second PEdevice may be a PE device, an SPE device, or the like.

A solution provided in this embodiment of the present disclosurecomprises a 301 part and a 302 part, and the following separatelydescribes the 301 part and the 302 part.

In the 301 part, the first PE device receives a data flow from acustomer edge CE device, and forwards the data flow to a PW trunkinterface, where the PW trunk interface is associated with at least twoactive PWs.

Before forwarding the data flow to the PW trunk interface, the first PEdevice creates the PW trunk interface. The PW trunk interface is alogical interface, and the logical interface is an interface that canimplement a data exchange function but does not physically exist andthat needs to be established by means of configuration, and is aninterface implemented by using a software technology. In an embodiment,the PW trunk interface may be created by a network administrator on thefirst PE device by means of configuration by using a command line, maybe created by the first PE device by means of configuration according toan instruction of a message that is sent by another control andmanagement device, or may be created by the first PE device by means ofautomatic configuration by running algorithm software. The logicalinterface is relative to a physical interface, and the physicalinterface is a hardware interface that can be seen by a person, forexample, an Ethernet interface on a router or a PE device.

After the first PE device creates the PW trunk interface, the PW trunkinterface is associated with the at least two PWs, and the at least twoPWs include at least two active PWs. The PW trunk interface isassociated with the at least two active PWs, and in this way, thisembodiment of the present disclosure provides the load sharingforwarding method for the data flow in order to increase a bandwidth anda throughput for transmitting the data flow by using the PW.

There may be two mechanisms for associating the PW trunk interface withat least two active PWs.

Mechanism 1: The first PE device directly uses the at least two PWsassociated with the PW trunk interface as active PWs. That is, the firstPE device directly uses, by default, all PWs associated with the PWtrunk interface to perform load sharing forwarding. Therefore, inMechanism 1, there is no need to determine an active/non-active state.The mechanism is applicable to an all-active PW deployment manner.

Mechanism 2: The first PE device determines at least two PWs as activePWs from the at least two PWs, and uses the determined at least twoactive PWs to perform load sharing forwarding. That is, the first PEdevice needs to select some or all of PWs as active PWs by means ofdetermining in order to perform load sharing forwarding. If some of thePWs are determined to be in the active state, a remaining PW is in anon-active state (used as a backup PW). Therefore, in Mechanism 2, thereis a need to determine an active/non-active state. The mechanism isapplicable to a multi-active PW load sharing (referred to asmulti-active PW or multi-active in this specification) deployment manneror an all-active PW load sharing (referred to as all-active PW orall-active in this specification) deployment manner.

Based on Mechanism 2, in the multi-active deployment manner and theall-active deployment manner, an active/non-active state of the PW needsto be determined on the first PE device, and determining theactive/non-active state of the PW may be directly completed (that is,there is no need to configure the following primary/secondary mode orthe following independent mode), or may be completed in the two modesafter the two modes are configured. One mode is the primary/secondarymode, and the PW trunk interface may be set to the primary/secondarymode. That is, the first PE device determines an active/non-active stateof the at least two PWs, and separately notifies a peer second PE deviceof a state of each PW. The other mode is the independent mode, and thePW trunk interface may be set to the independent mode. That is, afterthe active state of the PW is determined by another remote device (forexample, the second PE device), the first PE device is notified of theactive state of the PW. The second PE device determines theactive/non-active state of the at least two PWs, and separately notifiesthe first PE device of a state of each PW.

The following method for determining the active/non-active state of thePW is applicable to a scenario in which the first PE device directlydetermines the state and a scenario in which the first PE devicedetermines the state in the primary/secondary mode. It should be notedthat, when determining the state in the primary/secondary mode, thefirst PE device needs to configure the primary/secondary mode on the PWtrunk interface. Otherwise, when directly determining the state, thefirst PE device does not need to configure the primary/secondary mode orthe independent mode on the PW trunk interface.

In a specific implementation, the first PE device obtains an active PWquantity parameter, and determines, from the at least two PWs, at leasttwo PWs as active PWs according to the active PW quantity parameter. Theactive PW quantity parameter is a positive integer greater than or equalto 2, represents a quantity of PWs in an active state, and may beconfigured according to a requirement of networking or a user. In anembodiment, the active PW quantity parameter may be pre-configured by anetwork administrator on the first PE device by using a command line,may be configured by the first PE device according to an instruction ofa message that is sent by another control and management device, may beautomatically generated and configured by the first PE device by runningalgorithm software, or may be a default value configured during softwareimplementation of the first PE device. As shown in FIG. 2c , forexample, the PW trunk interface of the UPE1 is associated with two PWs(respectively, the PW1 and the PW2), and the active PW quantityparameter is 2; therefore, the PW1 and the PW2 are determined as activePWs.

By configuring the active PW quantity parameter, the user (for example,the network administrator or a user of a third party application) mayplan a load sharing PW according to a requirement of the user in orderto improve flexibility of PW load sharing deployment. In an embodiment,multi-active load sharing or all-active load sharing may be configuredaccording to the requirement of the user. When the active PW quantityparameter is set to be equal to a quantity of PWs associated with the PWtrunk interface, it indicates all-active load sharing deployment. Inthis case, a bandwidth of the PW can be used to a greatest extent, andbandwidths of all PWs are combined to provide a greatest bandwidthguarantee. However, no secondary PW is deployed for protection whenthere is a fault, and reliability is relatively low. When the active PWquantity parameter is set to be less than the quantity of PWs associatedwith the PW trunk interface, and is greater than 1, it indicatesmulti-active load sharing deployment. In this case, backup protection isadded for a primary load sharing PW. When one or more primary PWs arefaulty, it may be ensured that forwarding is not interrupted, abandwidth provided by the PW is not decreased, and a service is notaffected, and this improves reliability of PW load sharing.

In a specific implementation, that the first PE device determines, fromthe at least two PWs, M (that is, at least two) PWs as active PWsaccording to the active PW quantity parameter (for example, the activePW quantity parameter is set to M, and M is a positive integer greaterthan or equal to 2) may include the following manners.

Manner 1: The first PE device obtains a priority of each PW in the atleast two PWs, where the priority of the PW is used to indicateprecedence in using the PW as an active PW. In an embodiment, a methodfor obtaining the priority of each PW may be as follows. A networkadministrator pre-configures the priority of each PW on the first PEdevice by using a command line; or the first PE device receives amessage sent by another control and management device, where the messagecarries the priority of each PW; or the first PE device automaticallygenerates the priority of each PW by running an algorithm; or the firstPE device configures a default value of the priority of each PW duringsoftware implementation of the first PE device. The first PE devicedetermines, from the at least two PWs, M PWs with higher priority ranksas active PWs according to a descending order of the priorities of thePWs.

As shown in FIG. 2b , for example, a priority of the PW1 is 0, apriority of the PW2 is 1, a priority of the PW3 is 2, and a priority ofthe PW4 is 3. An ascending order of 0, 1, 2, 3, and . . . indicates adescending order of priorities. That is, the priority 0 indicates ahighest priority, and the priority 3 indicates a lowest priority. IfM=2, the PW1 and the PW2 with higher priorities are selected as activePWs.

By setting the priority of each PW, the user (for example, the networkadministrator or a user of a third party application) may more flexiblyplan a load sharing PW according to a requirement of the user in orderto further improve flexibility of PW load sharing deployment.

Manner 2: The first PE device obtains an IP address of a peer second PEof each PW in the at least two PWs, and determines, from the at leasttwo PWs, M PWs with a relatively large IP address as active PWsaccording to a descending order of the IP addresses of the peer secondPEs of the PWs. Alternatively, on the contrary, the first PE devicedetermines, from the at least two PWs, M PWs with a relatively small IPaddress as active PWs according to an ascending order of the IPaddresses of the peer second PEs of the PWs. As shown in FIG. 2b , forexample, an IP address of a peer SPE2-1 of the PW1 is 100.1.1.1/24, anIP address of a peer SPE2-2 of the PW2 is 90.1.1.1/24, an IP address ofa peer SPE2-3 of the PW3 is 80.1.1.1/24, and an IP address of a peerSPE2-4 of the PW4 is 70.1.1.1/24. A descending order of IP addresses isthe SPE2-1, the SPE2-2, the SPE2-3, and the SPE2-4. If M=2, the PW1 andthe PW2 whose peer PE devices have relatively large IP addresses areselected as active PWs. Alternatively, an ascending order of IPaddresses is the SPE2-4, the SPE2-3, the SPE2-2, and the SPE2-1. If M=2,the PW4 and the PW3 whose peer PE devices have relatively small IPaddresses are selected as active PWs.

The load sharing PW is selected according to an IP address of a peer PEdevice of each PW, and in this way, this embodiment of the presentdisclosure provides a PW load sharing method that is simple and easy toperform without a need of an extra setting.

Manner 3: The first PE device first obtains a priority of each PW in theat least two PWs; and when the first PE device determines at least twoPWs with higher priority ranks as active PWs according to a descendingorder of the priorities of the PWs in the at least two PWs, if there areat least two PWs with an equal priority, the first PE device thenobtains an IP address of a peer second PE of each PW in the at least twoPWs with the equal priority, and determines, from the at least two PWswith the equal priority, at least two PWs as active PWs according to anascending or a descending order of the IP addresses of the peer secondPEs of the PWs. Manner 3 is a combination of Manner 1 and Manner 2. Asshown in FIG. 2b , for example, the priority of the PW1 is 0, thepriority of the PW2 is 1, the priority of the PW3 is 1, and the priorityof the PW4 is 3; and the IP address of the peer SPE2-1 of the PW1 is100.1.1.1/24, the IP address of the peer SPE2-2 of the PW2 is90.1.1.1/24, the IP address of the peer SPE2-3 of the PW3 is80.1.1.1/24, and the IP address of the peer SPE2-4 of the PW4 is70.1.1.1/24. If M=2, the PW1 with the highest priority is firstdetermined according to the priorities; however, priorities of the PW2and the PW3 are equal (both are 1), and to meet M=2, one PW needs to beselected from the PW2 and the PW3. In this case, if a PW correspondingto a peer PE of a relatively large IP address is selected according to adescending order of IP addresses, because the IP address of the peerSPE2-2 of the PW2 is greater than the IP address of the peer SPE2-3 ofthe PW3, the PW2 is selected. Therefore, the PW1 and the PW2 are finallyselected as active PWs. Alternatively, if a PW corresponding to a peerPE of a relatively small IP address is selected according to anascending order of IP addresses, because the IP address of the peerSPE2-3 of the PW3 is smaller than the IP address of the peer SPE2-2 ofthe PW2, the PW3 is selected. Therefore, the PW1 and the PW3 are finallyselected as active PWs.

In this embodiment of the present disclosure, by using the method inwhich the priority and the IP address are combined, a problem that aload sharing PW cannot be determined according to the PW priority isresolved, and a solution in which a load sharing PW is preferablydetermined is provided, and this further improves accuracy andflexibility of PW load sharing deployment.

It should be noted that, two endpoints of a virtual circuit includingthe PW are the first PE device and the second PE device. From aperspective of the first PE device, a peer end of the PW is the secondPE device; and from a perspective of the second PE device, a peer end ofthe PW is the first PE device. In this embodiment of the presentdisclosure, from the perspective of the first PE device, an IP addressof the peer second PE device of the PW may be an IP address of aphysical interface of the PW on the second PE device, or may be amanagement IP address of the second PE device. In a PW load sharingdeployment scenario in which source nodes are the same and destinationnodes are the same, as shown in FIG. 2a , an IP address of a peer secondPE device of a PW is usually an IP address of a physical interface ofthe PW on the second PE device. In a PW load sharing deployment scenarioin which source nodes are the same but destination nodes are different,as shown in FIG. 2b and FIG. 2c , an IP address of a peer second PEdevice of a PW may be an IP address of a physical interface of the PW onthe second PE device, or may be a management IP address of the second PEdevice.

It should be further noted that, in this embodiment of the presentdisclosure, in addition to the manner of same source nodes and samedestination nodes and the manner of same source nodes and differentdestination nodes, the PW load sharing deployment manner may be a mannermixing the manner of same source nodes and same destination nodes andthe manner of same source nodes and different destination nodes. Asshown in FIG. 2d , a PW trunk interface on a UPE1 is associated withthree PWs, a PW1, a PW3, and a PW2, to perform load sharing, and both apeer endpoint of the PW1 and a peer endpoint of the PW3 are an SPE2-1(which belongs to the manner of same source nodes and same destinationnodes); and a peer endpoint of the PW2 is an SPE2-2. Therefore, the PW1and the PW2 belong to the manner of same source nodes and differentdestination nodes, and the PW3 and the PW2 also belong to the manner ofsame source nodes and different destination nodes.

The foregoing describes a manner for determining an active/non-activestate of the PW when the PW trunk interface is set to theprimary/secondary mode. The following uses an example to describe amanner for determining the active/non-active state of the PW in theindependent mode when the PW trunk interface is set to the independentmode. For example, as shown in FIG. 2b , a quantity of active PWs is setto 2 for the SPE2-1, the SPE2-2, the SPE2-3, and the SPE2-4. The four PEdevices run a communications protocol to notify IP addresses of the fourPE devices, and PWs corresponding to two PE devices (for example, theSPE2-1 and the SPE2-2) with relatively large IP addresses or relativelysmall IP addresses are selected to be in the active state. Therefore,the PW1 and the PW2 are in the active state, and the remaining PW3 andPW4 are in the non-active state. Therefore, the SPE2-1 and the SPE2-2separately notify the UPE1 that the PW1 and the PW2 are in the activestate, and the SPE2-3 and the SPE2-4 separately notify the UPE1 that thePW3 and the PW4 are in the non-active state. The UPE1 separately sets,on the UPE1 according to a notification message, the PW1 and the PW2that are associated with the PW trunk interface to the active state, andthe PW3 and the PW4 to the non-active state.

In a specific implementation, that the first PE device receives the dataflow from the CE device, and forwards the data flow to the PW trunkinterface comprises the following several manners.

Manner 1: The first PE device receives the data flow from the CE devicethrough an attachment circuit AC interface, and forwards the data flowto the PW trunk interface through the AC interface according to anassociation relationship between the AC interface and the PW trunkinterface. The association relationship (as shown in Table 0) may becompleted by means of configuration when the PW trunk interface or theAC interface is created. This manner is applicable to a typical PWnetworking L2VPN scenario shown in FIG. 2a , and a scenario that isshown in FIG. 2b and FIG. 2c and in which the PW accesses an EVPN and aPW access network is a virtual leased line (VLL). A point-to-pointservice can be provided by using a VLL L2VPN technology.

TABLE 0 Association relationship between the AC interface and the PWtrunk interface AC interface PW trunk interface AC interface 1 PW trunkinterface 1 . . . . . .

Manner 2: The first PE device receives the data flow from the CE devicethrough an attachment circuit AC interface, forwards the data flow to avirtual switch instance (VSI) through the AC interface, searches a MACforwarding table (as shown in Table 1) in the VSI to obtain the PW trunkinterface, and forwards the data flow to the PW trunk interface. Thismanner is applicable to a scenario that is shown in FIG. 2b and FIG. 2cand in which the PW accesses an EVPN and a PW access network is a VPLS.A multipoint service based on the Ethernet can be provided by using aVPLS L2VPN technology. FIG. 2b is used as an example, the UPE1 receivesa data flow from the CE1 through the AC interface 1, and a destinationMAC address carried in the data flow is a MAC address of the UE2. Thatis, a destination of the data flow is the UE2. The UPE1 forwards thedata flow to the VSI through the AC interface 1, and the VSI comprisesthe MAC forwarding table (as shown in Table 1). The UPE1 uses the MACaddress of the UE2 as an index (or may be referred to as a match entry,a keyword, or the like) to search the MAC forwarding table shown inTable 1 in order to learn that an outbound interface that matches theMAC address of the UE2 is a PW trunk interface 1. It should be notedthat, herein the MAC forwarding table is only used as an example, and isused to indicate an association relationship between a destination MACaddress and a PW trunk interface. The MAC forwarding table may furtherinclude another parameter, and this is not limited herein.

Further, a method for generating a MAC forwarding table entry in Table 1is described by using examples. The first PE device (for example, theUPE1 in FIG. 2b ) receives a MAC broadcast packet from the second PEdevice (for example, the SPE2-1 or the SPE2-2 in FIG. 2b ), adestination MAC address carried in a MAC broadcast packet header is aMAC broadcast address, and a source MAC address carried in the MACbroadcast packet header is a MAC address of the UE2. The UPE1 obtains aninner label (used to represent information about a VPN to which userdata belongs, and may also be referred to as a VPN label, a virtualcircuit (VC) label, or a VC identifier carried in a payload part of theMAC broadcast packet, and obtains, according to an associationrelationship between the inner label and a PW identifier, the PWidentifier (for example, the PW1 or the PW2) corresponding to the innerlabel; then obtains a PW trunk interface according to an associationrelationship (as shown in the following Table 2) between the PWidentifier and the PW trunk interface; and finally, uses source MAC(that is, the MAC address of the UE2) carried in the MAC broadcastpacket header as destination MAC, and uses the PW trunk interfaceobtained in the foregoing step as an outbound interface to generate aMAC forwarding table entry shown in Table 1. It should be noted that,the MAC forwarding table entry generation process is completed byperforming MAC address flooding and learning in a data plane of the UPE1after the PW trunk interface is created and is associated with the PW onthe UPE1. After being generated, the MAC forwarding table entry is usedto instruct subsequent data packet forwarding of a user. The MACforwarding table entry generation method in this embodiment of thepresent disclosure is only a possible embodiment, and is not construedas a limitation on the present disclosure.

TABLE 1 MAC forwarding table Destination MAC Outbound interface MACaddress of the UE2 PW trunk interface . . . . . .

It should be noted that, an MPLS L2VPN means that user layer 2 data istransparently transmitted on an MPLS network. From a perspective of theuser, the MPLS network is a layer 2 switching network, and a layer 2connection may be established between different nodes. The MPLS L2VPNcomprises manners such as a VLL and a VPLS, and both layer 2 connectionsprovided by the VLL and the VPLS are PWs. A difference lies in that theVLL provides a point-to-point VPN service, and comprises one PW;however, the VPLS provides a multipoint VPN service, and comprisesmultiple PWs.

In the 302 part, the first PE device performs load sharing processing onthe data flow, and forwards the data flow by using the at least twoactive PWs.

As shown in FIG. 2a , the first PE device (PE1) performs load sharingforwarding on the data flow by using the two selected active PWs, thePW1 and the PW2. This case belongs to all-active load sharingdeployment, both two PWs associated with the PW trunk interface are usedto perform load sharing forwarding, and no secondary PW is deployed forprotection when there is a fault. In addition, with this deployment, abandwidth of the PW may be used to a greatest extent, and bandwidths ofall PWs are combined to provide a bandwidth of a maximum capability.

As shown in FIG. 2b , the first PE device (UPE1) selects two active PWs,the PW1 and the PW2, as primary PWs to perform load sharing forwardingon the data flow, and uses the remaining PW3 and PW4 as secondary PWssuch that when a primary PW is faulty, the PW may be switched to asecondary PW in order to perform load sharing forwarding. For example,when the PW1 is faulty (the PW1 is switched to a non-active state), thebackup PW3 may be enabled (the PW3 is switched to an active state), andtwo active PWs, the PW2 and the PW3, are used to continuously performload sharing forwarding on the data flow. Alternatively, when both thePW1 and the PW2 are faulty (both the PW1 and the PW2 are switched to anon-active state), the backup PW3 and PW4 may be enabled (both the PW3and PW4 are switched to an active state), and two active PWs, the PW3and the PW4, are used to continuously perform load sharing forwarding onthe data flow. This case belongs to a multi-active load sharingdeployment scenario. In this case, backup protection is added for aprimary load sharing PW. When one or more primary PWs are faulty, it maybe ensured that forwarding is not interrupted, a bandwidth provided bythe PW is not decreased, and a service is not affected, and thisimproves reliability of PW load sharing.

As shown in FIG. 2c , the first PE device (UPE1) performs load sharingforwarding on the data flow by using two active PWs, the PW1 and thePW2. This case belongs to all-active load sharing deployment, an effectis the same as that of FIG. 2a , and details are not described herein.

In a specific implementation, a specific load sharing implementation maybe establishing a PW trunk forwarding table (such as Table 2) on thefirst PE device. After the PW trunk interface of the first PE devicereceives the data flow, the first PE device performs, by using a hashalgorithm and based on a configured hash gene, cyclic redundancy check(CRC) to obtain a check value, performs a modulo operation according toa load-sharing PW quantity value by using the check value to obtain aremainder, uses the remainder as a key value, and then uses the keyvalue as an index to search the PW trunk forwarding table in order tomatch a PW for forwarding.

It should be noted that, input of the hash algorithm is an eigenvalue ofeach packet, and the eigenvalue is referred to as a hash gene. A packeteigenvalue that can be used as a hash gene comprises but is not limitedto: a source MAC address, a destination MAC address, and the likeincluded in an Ethernet frame header; a source IP address, a destinationIP address, a protocol number, and the like included in an IP packetheader; a source port number, a destination port number, and the likeincluded in a TCP/UDP packet header; an MPLS label, some bits of packetload, and the like included in an MPLS packet header; and a tunnelidentifier (Tunnel ID) and a session identifier (Session ID), and thelike included in an L2TP packet header, and the like. The hash gene maybe one or any combination of several of the packet eigenvalues. Thecombination of several of the eigenvalues may also be referred to as anN-tuple (N is a positive integer greater than or equal to 1), and theN-tuple is used to identify one service flow. In an embodiment, the hashgene may be pre-configured by a network administrator on the first PEdevice by using a command line, may be configured by the first PE deviceaccording to an instruction of a message that is sent by another controland management device, may be automatically generated and configured bythe first PE device by running algorithm software, or may be a defaultvalue configured during software implementation of the first PE device.

It should be further noted that, the data flow in the present disclosurerefers to a digital coded signal (a data packet) sequence used totransmit (receive or send) information. The data flow comprises ordereddata packets, and the data flow may include detailed service flows. Forexample, as shown in FIG. 2b , the service flow is identified by a5-tuple including a source IP address, a destination IP address, aprotocol number, a source port number, and a destination port number.The CE1 receives a service flow 1 from UE1-1, and the service flow 1 isidentified by a 5-tuple 1. A source IP address in the 5-tuple 1 is an IPaddress of the UE1-1, and a destination IP address in the 5-tuple 1 isan IP address of UE2. The CE1 further receives a service flow 2 fromUE1-2, and the service flow 2 is identified by a 5-tuple 2. A source IPaddress in the 5-tuple 2 is an IP address of the UE1-2, and adestination IP address in the 5-tuple 2 is the IP address of the UE2.The CE1 sends a data flow including the service flow 1 and the serviceflow 2 to the UPE1.

With reference to the foregoing description, Table 2 is further used asan example to describe the load sharing procedure. As shown in Table 2,a PW activity quantity value is set to 2 on the UPE1, the PW trunkinterface is associated with two active PWs, the PW1 and the PW2, andload sharing is performed by using the two PWs. The UPE1 receives thedata flow from the CE1 through an AC interface 1. When CRC check isperformed on the 5-tuple 1 (used to identify the service flow 1) in thedata flow to obtain a CRC check value 1, and a modulo operation is thenperformed by using the CRC check value 1 and the PW quantity value(equal to 2) to obtain a remainder key1, the PW1 is used to forward theservice flow 1. When CRC check is performed on the 5-tuple 2 (used toidentify the service flow 2) in the data flow to obtain a CRC checkvalue 2, and a modulo operation is then performed by using the CRC checkvalue 2 and the PW quantity value (equal to 2) to obtain a remainderkey2, the PW2 is used to forward the service flow 2. Therefore, PW loadsharing forwarding for the data flow including the service flow 1 andthe service flow 2 is implemented. Therefore, the load sharing methodbelongs to per-flow load sharing or per-service-flow load sharing.Because the service flow 1 is sent in order by using the PW1, and theservice flow 2 is sent in order by using the PW2, packets do not need tobe reassembled on a receive end in order, and per-flow load sharing hasa better order preserving capability for a user service flow.

It should be further noted that, the PW trunk forwarding table shown inTable 2 is only an example, and is used to indicate the associationrelationship between a PW trunk interface and a load sharing PW andinstruct forwarding of a data flow. The PW trunk forwarding table mayfurther include one or more of parameters such as an inner label (forexample, a virtual circuit identifier (VC ID)), an outer tunnel label,and a peer IP address of the PW, and this is not limited herein.

TABLE 2 PW trunk forwarding table PW trunk interface Identifier of aload identifier Key value sharing PW PW trunk interface Key1 PW1 PWtrunk interface Key2 PW2 . . . . . . . . .

With the method for performing a hash operation on an eigenvalue in adata packet, this embodiment of the present disclosure provides theper-flow PW load sharing method. In the method, not only a betterservice flow order preserving effect is obtained, but also a bandwidthand a throughput of the PW are increased. This enhances a dataprocessing capability of a PE device or a UPE device and improves PWdeployment flexibility.

In a specific implementation, a specific load sharing implementation maybe establishing a PW trunk forwarding table (such as Table 3) on thefirst PE device. A timer is enabled on the first PE device, and eachtime a data packet arrives, a value of a counter is increased by 1.After the PW trunk interface of the first PE device receives the dataflow (for details, refer to description of the data flow in anembodiment, where the data flow comprises ordered data packets), thefirst PE device selects, according to a value obtained by the counter bycounting each data packet, a PW to perform load sharing forwarding. Forexample, the first PE device receives the first data packet, a countvalue is 1, and the first PE device searches Table 3 to obtain anidentifier PW1 of a corresponding load sharing PW, and uses the PW1 toforward the first data packet. Then, the first PE device receives thesecond data packet, a count value is 2, and the first PE device searchesTable 3 to obtain an identifier PW2 of a corresponding load sharing PW,and uses the PW2 to forward the second data packet. Likewise, the PW1 isused to forward the third data packet, and the PW2 is used to forwardthe fourth data packet in sequence . . . in order to implement PW loadsharing. It may be learned that, in the method, an eigenvalue (refer tothe eigenvalue described in the hash gene part, and details are notdescribed herein) carried in the data packet does not need to beidentified. That is, the service flow does not need to be identified toperform forwarding, and therefore, the method belongs to a per-packetload sharing method. Because the service flow does not need to befurther identified, forwarding efficiency is relatively high.

TABLE 3 PW trunk forwarding table PW trunk interface Identifier of aload identifier Count value sharing PW PW trunk interface 1 PW1 PW trunkinterface 2 PW2 PW trunk interface 3 PW1 PW trunk interface 4 PW2 . . .. . . . . .

It should be noted that, the PW trunk forwarding table shown in Table 3is only an example, and is used to indicate the association relationshipbetween a PW trunk interface and a load sharing PW and instructforwarding of the data flow. The PW trunk forwarding table may furtherinclude one or more of parameters such as an inner label (VC ID), anouter tunnel label, and a peer IP address of the PW, and this is notlimited herein.

With the method for performing a hash operation on an eigenvalue in adata packet, this embodiment of the present disclosure provides theper-packet PW load sharing method. In the method, not only forwardingefficiency is relatively high, but also a bandwidth and a throughput ofthe PW are increased. This enhances a data processing capability of a PEdevice or a UPE device and improves PW deployment flexibility.

It should be noted that, two active PWs used to perform load sharingforwarding on the data flow are only used as an example for descriptionin the foregoing; in specific implementation, there may be three, four,. . . , (that is, at least two) active PWs, and this is not limitedherein.

To enable a person skilled in the art to more clearly understand theforwarding procedure, the following describes a forwarding processingprocedure in which a PE device receives a data packet and forwards thedata packet.

FIG. 4a is a schematic flowchart of a forwarding embodiment in which aPE device uses a PW trunk interface to perform load sharing forwarding.This manner is applicable to typical PW networking shown in FIG. 2a ,and a scenario that is shown in FIG. 2b and FIG. 2c and in which a PWaccesses an EVPN and a PW access network is a VLL L2VPN. In thisembodiment, a PE1 receives a data packet 1 from a CE device through anAC interface, and forwards the data packet 1 to a PW trunk interfaceaccording to an association relationship between the AC interface andthe PW trunk interface, and the PW trunk interface is associated with aPW1 and a PW2. Then, the PE1 uses the load sharing manner mentioned inthe foregoing embodiment to perform load sharing between the PW1 and thePW2. That is, the PE1 performs CRC check according to a hash gene 1 (forexample, a source IP address is an IP address of UE1-1, and adestination IP address is an IP address of UE2) carried in the datapacket 1 to obtain a check value 1, performs a modulo operation by usingthe check value 1 and a PW quantity value (equal to 2) to obtain a key1,and uses the key1 as an index to search a PW trunk forwarding table toobtain the PW1 that matches the key1. Finally, the PE1 obtains, by usinga tunnel 1 carrying the PW1, that an inbound interface of the tunnel 1is a physical interface 1 (for example, an Ethernet interface 1), andforwards the data packet 1 by using the physical interface 1.

Then, the PE1 receives a data packet 2 from the CE device through the ACinterface, and forwards the data packet 2 to the PW trunk interfaceaccording to the association relationship between the AC interface andthe PW trunk interface, and the PW trunk interface is associated withthe PW1 and the PW2. Then, the PE1 performs CRC check according to ahash gene 2 (for example, a source IP address is an IP address of UE1-2,and a destination IP address is an IP address of UE2) carried in thedata packet 2 to obtain a check value 2, performs a modulo operation byusing the check value 2 and a PW quantity value (equal to 2) to obtain akey2, and uses the key2 as an index to search the PW trunk forwardingtable to obtain the PW2 that matches the key2. Finally, the PE1 obtains,by using a tunnel 2 carrying the PW2, that an inbound interface of thetunnel 2 is a physical interface 2 (for example, an Ethernet interface2), and forwards the data packet 2 by using the physical interface 2.

Likewise, the PE1 continues to receive data packets 3, 4, 5, . . . (thedata packets 1, 2, 3, . . . form a data flow, and the data flowcomprises a service flow 1 identified by the hash gene 1 and a serviceflow 2 identified by the hash gene 2) from the CE device through the ACinterface. According to the foregoing method, the PE1 performs a modulooperation by using a check value obtained after CRC check is performedon a hash gene carried in each data packet and the PW quantity value(equal to 2) to respectively obtain the key1 or the key2 in order toobtain the corresponding PW1 or PW2. Therefore, the service flow 1 isforwarded by the PW1, the service flow 2 is forwarded by the PW2, andload sharing forwarding is implemented for the data flow. This enhancesa data processing capability, increases a bandwidth and a throughput,improves PW deployment flexibility, and obtains a better service floworder preserving capability.

FIG. 4b is a schematic flowchart of another forwarding embodiment inwhich a PE device uses a PW trunk interface to perform load sharingforwarding. This manner is applicable to a scenario that is shown inFIG. 2b and FIG. 2c and in which a PW accesses an EVPN and a PW accessnetwork is a VPLS L2VPN. In this embodiment, a PE1 receives a datapacket 1 from a CE device through an AC interface, and the data packet 1carries a MAC address of destination UE. The PE1 forwards the datapacket 1 to a VSI through the AC interface, uses the MAC address of thedestination UE to search a MAC forwarding table in order to obtain thata matched outbound interface is a PW trunk interface, and forwards thedata packet 1 to the PW trunk interface, and the PW trunk interface isassociated with a PW1 and a PW2. Then, the PE1 performs CRC checkaccording to a hash gene 1 (for example, a source IP address is an IPaddress of UE1-1, and a destination IP address is an IP address of UE2)carried in the data packet 1 to obtain a check value 1, performs amodulo operation by using the check value 1 and a PW quantity value(equal to 2) to obtain a key1, and uses the key1 as an index to search aPW trunk forwarding table to obtain the PW1 that matches the key1.Finally, the PE1 obtains, by using a tunnel 1 carrying the PW1, that aninbound interface of the tunnel 1 is a physical interface 1 (forexample, an Ethernet interface 1), and forwards the data packet 1 byusing the physical interface 1.

Then, the PE1 receives a data packet 2 from the CE device through the ACinterface, and the data packet 2 carries a MAC address of destinationUE. The PE1 forwards the data packet 2 to the VSI through the ACinterface, uses the MAC address of the destination UE to search the MACforwarding table in order to obtain that a matched outbound interface isthe PW trunk interface, and forwards the data packet 2 to the PW trunkinterface, and the PW trunk interface is associated with the PW1 and thePW2. Then, the PE1 performs CRC check according to a hash gene 2 (forexample, a source IP address is an IP address of UE1-2, and adestination IP address is an IP address of UE2) carried in the datapacket 2 to obtain a check value 2, performs a modulo operation by usingthe check value 2 and a PW quantity value (equal to 2) to obtain a key2,and uses the key2 as an index to search the PW trunk forwarding table toobtain the PW2 that matches the key2. Finally, the PE1 obtains, by usinga tunnel 2 carrying the PW2, that an inbound interface of the tunnel 2is a physical interface 2 (for example, an Ethernet interface 2), andforwards the data packet 2 by using the physical interface 2.

Likewise, the PE1 continues to receive data packets 3, 4, 5, . . . (thedata packets 1, 2, 3, . . . form a data flow, and the data flowcomprises a service flow 1 identified by the hash gene 1 and a serviceflow 2 identified by the hash gene 2) from the CE device through the ACinterface. According to the foregoing method, the PE1 performs a modulooperation by using a check value obtained after CRC check is performedon each data packet and the PW quantity value (equal to 2) torespectively obtain the key1 or the key2 in order to obtain thecorresponding PW1 or PW2. Therefore, the service flow 1 is forwarded bythe PW1, the service flow 2 is forwarded by the PW2, and load sharingforwarding is implemented for the data flow on the PW1 and the PW2. Thisenhances a data processing capability of a PE device, increases abandwidth and a throughput, improves PW deployment flexibility, andobtains a better service flow order preserving capability.

It should be noted that, in FIG. 4a and FIG. 4b , performing PW loadsharing according to the hash gene is used as an example to describe theforwarding procedure, a forwarding procedure of performing load sharingaccording to a count value is similar to this, and a difference onlylies in that a corresponding PW is found by using the count value. Fordetails, refer to the method related to Table 3. For brevity, detailsare not described herein.

It should be understood that, in this embodiment of the presentdisclosure, that one PW trunk interface and one AC interface are createdon the first PE device is used as an example for description, but thisis not construed as a limitation. In actual deployment, at least one PWtrunk interface and at least one AC interface may be separately created.

It should be further understood that, according to the foregoingdescription of scenarios in FIG. 2a , FIG. 2b , and FIG. 2c , the firstPE device may be a PE device in typical single-layer networking, or maybe a UPE device in hierarchical networking according to differentnetworking situations. The PE device in the single-layer networking orthe UPE device in the hierarchical networking is described from aperspective of a location of the device in network deployment or amanagement domain, is a device located on a provider network edge, andis connected to a device (for example, a CE device) in a customernetwork. Essentially, the PE device or the UPE device is a networkdevice, for example, a router or a switch.

FIG. 5a shows a possible schematic structural diagram of a first PEdevice related to the foregoing embodiment. A first PE device 500comprises a main control board 510, an interface board 530, a switchingboard 520, and an interface board 540. The main control board 510 isconfigured to complete functions such as system management, devicemaintenance, and protocol processing. The switching board 520 isconfigured to complete data exchange between interface boards (theinterface board is also referred to as a line card or a service board).The interface board 530 and the interface board 540 are configured toprovide various service interfaces (for example, a POS interface, a GEinterface, and an ATM interface), and implement rapid forwarding of adata packet. A control plane comprises management and control units ofthe main control board 510 and management and control units on theinterface board 530 and the interface board 540. The main control board510 mainly comprises three types of function units: a system managementand control unit, a system clock unit, and a system maintenance unit.The system management and control unit and the system clock unit arecontrol plane function units, and the system maintenance unit is amonitoring plane function unit. The main control board 510, theinterface board 530 and the interface board 540, and the switching board520 are connected to a system backplane by using a system bus in orderto implement communication between each other.

A physical interface card 533 on the interface board 530 is configuredto receive a data flow from a CE device. A network processor 532 isconfigured to forward the data flow to a PW trunk interface, and performload sharing processing on the data flow, where the PW trunk interfaceis associated with at least two active PWs. If a physical port of anouter tunnel carrying the at least two active PWs is on the interfaceboard 530, an interface on the physical interface card 533 is used tosend the data flow. In this case, it should be noted that, the interfacefor sending the data flow is different from an interface for receivingthe data flow from the CE device. When the interface board 530 hasanother physical interface card 535, the interface for sending the dataflow may be on the physical interface card 535. If the physical port ofthe tunnel carrying the at least two active PWs is on the interfaceboard 540, the data flow is first sent to the interface board 540 byusing the switching board 520, and the data flow is then sent by usingan interface on a physical interface card 543.

Before the network processor 532 is configured to forward the data flowto the PW trunk interface, a central processing unit 511 on the maincontrol board 510 is configured to create the PW trunk interface,associate the PW trunk interface with the at least two PWs, anddetermine at least two PWs as active PWs from the at least two PWs.Then, the central processing unit 511 generates a PW trunk forwardingtable entry (such as Table 2 or Table 3), and forwards the PW trunkforwarding table entry to the interface board 530 and/or the interfaceboard 540. A forwarding table entry memory 534 of the interface board530 and/or a forwarding table entry memory 544 of the interface board540 are/is configured to store the PW trunk forwarding table entry.

In a possible implementation, the central processing unit 511 on themain control board 510 is further configured to obtain an active PWquantity parameter, where the active PW quantity parameter represents aquantity of PWs in an active state, and is a positive integer greaterthan or equal to 2; and determine at least two active PWs from the atleast two PWs according to the active PW quantity parameter.

The central processing unit 511 on the main control board 510 is furtherconfigured to obtain the active PW quantity parameter. In a possibleimplementation, the central processing unit 511 is further configured toobtain a priority of each PW in the at least two PWs, and determine,from the at least two PWs, at least two PWs with higher priority ranksas active PWs according to a descending order of the priorities of thePWs and the active PW quantity parameter. The priority of the PW is usedto indicate precedence in using the PW as an active PW.

The central processing unit 511 on the main control board 510 is furtherconfigured to obtain the active PW quantity parameter. In anotherpossible implementation, the central processing unit 511 is furtherconfigured to obtain an IP address of a peer second PE of each PW in theat least two PWs, and determine, from the at least two PWs, at least twoPWs with higher IP address ranks as active PWs according to a descendingorder of the IP addresses of the peer second PEs of the PWs and theactive PW quantity parameter.

The central processing unit 511 on the main control board 510 is furtherconfigured to obtain the active PW quantity parameter. In still anotherpossible implementation, the central processing unit 511 is furtherconfigured to obtain an IP address of a peer second PE of each PW in theat least two PWs, and determine, from the at least two PWs, at least twoPWs with higher IP address ranks as active PWs according to an ascendingorder of the IP addresses of the peer second PEs of the PWs and theactive PW quantity parameter.

The central processing unit 511 on the main control board 510 is furtherconfigured to obtain the active PW quantity parameter. In yet anotherpossible implementation, the central processing unit 511 is furtherconfigured to obtain a priority of each PW in the at least two PWs andan IP address of a peer second PE of each PW in the at least two PWs,and determine at least two PWs as active PWs according to the priorityof each PW in the at least two PWs, the IP address of the peer second PEof each PW in the at least two PWs, and the active PW quantityparameter.

In another possible implementation, a physical interface (connected tothe CE device, and configured as an AC interface by the centralprocessing unit 511 on the main control board 510) on the physicalinterface card 533 on the interface board 530 is configured to receivethe data flow from the CE device. The forwarding table entry memory 534on the interface board 530 is further configured to store an associationrelationship table entry (such as Table 0) between an AC interface and aPW trunk interface. The network processor 532 on the interface board 530is further configured to search for an association relationship betweenthe AC interface and the PW trunk interface, and forward the data flowto the PW trunk interface. The central processing unit 511 on the maincontrol board 510 generates an association relationship table entrybetween the AC interface and the PW trunk interface, and delivers theassociation relationship table entry between the AC interface and the PWtrunk interface to the forwarding table entry memory 534 on theinterface board 530 and/or the forwarding table entry memory 544 on theinterface board 540.

In still another possible implementation, a physical interface(connected to the CE device, and configured as an AC interface) on thephysical interface card 533 on the interface board 530 is configured toreceive the data flow from the CE device. The forwarding table entrymemory 534 on the interface board 530 is further configured to store aMAC forwarding table (such as Table 1, storing an associationrelationship between destination MAC and a PW trunk interface). Thenetwork processor 532 on the interface board 530 is further configuredto forward the data flow to a virtual switch instance VSI, search theMAC forwarding table in the VSI to obtain the PW trunk interface, andforward the data flow to the PW trunk interface. The network processor532 on the interface board 530 generates a MAC forwarding table entry,and sends the MAC forwarding table entry to the forwarding table entrymemory 534 on the interface board 530 for storage. It should be notedthat, in some possible designs, generation of the MAC forwarding tableentry may be completed by a dedicated Ethernet processing chip, and thisis not limited herein.

In yet another possible implementation, the central processing unit 511on the main control board 510 is further configured to generate anassociation relationship among the PW trunk interface, a key value(refer to description of per-flow load sharing in the 302 part), and theat least two active PWs, and the forwarding table entry memory 534 onthe interface board 530 is further configured to store the associationrelationship among the PW trunk interface, the key value, and the atleast two active PWs.

In yet another possible implementation, the central processing unit 511on the main control board 510 is further configured to generate anassociation relationship among the PW trunk interface, a count value(refer to description of per-packet load sharing in the 302 part), andthe at least two active PWs, and the forwarding table entry memory 534on the interface board 530 is further configured to store theassociation relationship among the PW trunk interface, the count value,and the at least two active PWs.

The first PE device 500 in this embodiment of the present disclosure maybe corresponding to the first PE device in the PW load sharing methodembodiments, and modules and the other operations and/or functions ofthe first PE device 500 are separately used to implement steps andmethods that are implemented by the first PE device in the embodimentscorresponding to FIG. 2a to FIG. 4b . For brevity, details are notdescribed herein.

It should be noted that, there may be one or more main control boards.When there are multiple main control boards, the multiple main controlboards may include a primary main control board and a secondary maincontrol board. There may be one or more interface boards, and a strongerdata processing capability of the first PE device indicates a largerquantity of provided interface boards. There may be one or more physicalinterface cards on the interface board. There may be no switching board,or may be one or more switching boards. When there are multipleswitching boards, the multiple switching boards may jointly implementload sharing redundancy backup. In a centralized forwardingarchitecture, the first PE device may not need a switching board, andthe interface board implements a service data processing function in theentire system. In a distributed forwarding architecture, the first PEdevice may have at least one switching board, and data exchange betweenmultiple interface boards is implemented by using the switching board inorder to provide a large-capacity data exchange and processingcapability. Therefore, a data access and processing capability of thefirst PE device in the distributed architecture is better than that of adevice in the centralized architecture. A specific architecture dependson a specific networking deployment scenario, and this is not limitedherein.

FIG. 5b shows another possible schematic structural diagram of a firstPE device related to the foregoing embodiment and a schematic blockdiagram of a controller 1510. This product form is applicable to anetwork architecture (for example, software-defined networking (SDN)) inwhich control and forwarding are separated. In the SDN, the main controlboard 510 of the first PE device 500 shown in FIG. 5a is separated fromthe device, and forms a new independent physical device (that is, thecontroller 1510 shown in FIG. 5b ), and remaining components formanother independent physical device (that is, a first PE device 1500shown in FIG. 5b ). The controller 1510 interacts with the first PEdevice 1500 by using a control channel protocol. The control channelprotocol may be the OpenFlow protocol, the Path Computation ElementCommunication Protocol (PCEP), the Border Gateway Protocol (BGP), theInterface to the Routing System (Interface to the Routing System, I2RS),or the like.

The controller 1510 may be implemented based on a general purposephysical server or a dedicated hardware structure. In a design example,the controller comprises a receiver, a processor, a transmitter, arandom access memory, a read-only memory, and a bus. The processor isseparately coupled to the receiver, the transmitter, the random accessmemory, and the read-only memory by using the bus. When the controllerneeds to be run, a basic input/output system or a bootloader in anembedded system that is built into the read-only memory is used to leada system to start, and lead the controller to enter a normal runningstate. After entering the normal running state, the controller runs anapplication program and an operating system in the random access memorysuch that the processor executes all functions and steps of the maincontrol board 510 in FIG. 5 a.

The first PE device 1500 may be implemented based on a dedicatedhardware structure, and functions and structures of the first PE deviceremain the same as functions and structures of the interface board 530,the interface board 540, and the switching board 520 in FIG. 5b in orderto execute corresponding steps. Alternatively, the first PE device 1500may be a virtual PE device implemented based on a general purposephysical server and a Network Functions Virtualization (NFV) technology,and the virtual PE device is a virtual router.

The controller 1510 and modules and the other operations and/orfunctions of the first PE device 1500 are separately used to implementsteps and methods that are implemented by the first PE device in theembodiments corresponding to FIG. 2a to FIG. 4b . For brevity, detailsare not described herein.

FIG. 6 shows still another possible schematic structural diagram of afirst PE device related to the foregoing embodiment. A first PE device600 comprises a receiving unit 602, a processing unit 604, and a sendingunit 606.

The receiving unit 602 is configured to receive a data flow from a CEdevice. The processing unit 604 is configured to forward the data flowto a PW trunk interface, and perform load sharing processing on the dataflow, where the PW trunk interface is associated with at least twoactive PWs. The sending unit 606 is configured to forward the data flowby using the at least two active PWs.

Before the processing unit 604 is configured to forward the data flow tothe PW trunk interface, the processing unit 604 is further configured tocreate the PW trunk interface, associate the PW trunk interface with theat least two PWs, and determine at least two PWs as active PWs from theat least two PWs.

In a possible implementation, the processing unit 604 is furtherconfigured to obtain an active PW quantity parameter, where the activePW quantity parameter represents a quantity of PWs in an active state,and is a positive integer greater than or equal to 2; and determine atleast two active PWs from the at least two PWs according to the activePW quantity parameter.

The processing unit 604 is configured to obtain the active PW quantityparameter. In a possible implementation, the processing unit 604 isfurther configured to obtain a priority of each PW in the at least twoPWs, and determine, from the at least two PWs, at least two PWs withhigher priority ranks as active PWs according to a descending order ofthe priorities of the PWs and the active PW quantity parameter. Thepriority of the PW is used to indicate precedence in using the PW as anactive PW.

The processing unit 604 is configured to obtain the active PW quantityparameter. In another possible implementation, the processing unit 604is further configured to obtain an IP address of a peer second PE ofeach PW in the at least two PWs, and determine, from the at least twoPWs, at least two PWs with higher IP address ranks as active PWsaccording to a descending order of the IP addresses of the peer secondPEs of the PWs and the active PW quantity parameter.

The processing unit 604 is configured to obtain the active PW quantityparameter. In still another possible implementation, the processing unit604 is further configured to obtain an IP address of a peer second PE ofeach PW in the at least two PWs, and determine, from the at least twoPWs, at least two PWs with higher IP address ranks as active PWsaccording to an ascending order of the IP addresses of the peer secondPEs of the PWs and the active PW quantity parameter.

The processing unit 604 is configured to obtain the active PW quantityparameter. In yet another possible implementation, the processing unit604 is further configured to obtain a priority of each PW in the atleast two PWs and an IP address of a peer second PE of each PW in the atleast two PWs, and determine at least two PWs as active PWs according tothe priority of each PW in the at least two PWs, the IP address of thepeer second PE of each PW in the at least two PWs, and the active PWquantity parameter.

In another possible implementation, the receiving unit 602 is configuredto receive the data flow from the CE device through an attachmentcircuit AC interface. The processing unit 604 is configured to forwardthe data flow to the PW trunk interface according to an associationrelationship between the AC interface and the PW trunk interface. Thefirst PE device 600 further comprises a storage unit, configured tostore the association relationship between the AC interface and the PWtrunk interface.

In still another possible implementation, the receiving unit 602 isconfigured to receive the data flow from the CE device through anattachment circuit AC interface. The processing unit 604 is configuredto forward the data flow to a virtual switch instance VSI, search a MACforwarding table in the VSI to obtain the PW trunk interface, andforward the data flow to the PW trunk interface. The first PE device 600further comprises a storage unit, configured to store the MAC forwardingtable.

In yet another possible implementation, the processing unit 604 isfurther configured to generate an association relationship among the PWtrunk interface, a key value (refer to description of per-flow loadsharing in the 302 part), and the at least two active PWs, and thestorage unit is further configured to store the associationrelationship.

In yet another possible implementation, the processing unit 604 isfurther configured to generate an association relationship among the PWtrunk interface, a count value (refer to description of per-packet loadsharing in the 302 part), and the at least two active PWs, and thestorage unit is further configured to store the associationrelationship.

The first PE device 600 in this embodiment of the present disclosure maybe corresponding to the first PE device in the PW load sharing methodembodiments, and modules and the other operations and/or functions ofthe first PE device 600 are separately used to implement steps andmethods that are implemented by the first PE device in the embodimentscorresponding to FIG. 2a to FIG. 4b . For brevity, details are notdescribed herein.

FIG. 7 shows yet another possible schematic structural diagram of afirst PE device related to the foregoing embodiment. A first PE device700 comprises a receiver 710, a processor 720, a transmitter 730, arandom access memory 740, a read-only memory 750, and a bus 760. Theprocessor 720 is separately coupled to the receiver 710, the transmitter730, the random access memory 740, and the read-only memory 750 by usingthe bus 760. When the first PE device 700 needs to be run, a basicinput/output system or a bootloader in an embedded system that is builtinto the read-only memory 750 is used to lead a system to start, andlead the first PE device 700 to enter a normal running state. Afterentering the normal running state, the first PE device 700 runs anapplication program and an operating system in the random access memory740 in order to implement the following functions.

The receiver 710 is configured to receive a data flow from a CE device.The processor 720 is configured to forward the data flow to a PW trunkinterface, where the PW trunk interface is associated with at least twoactive PWs; and perform load sharing processing on the data flow. Thetransmitter 730 is configured to forward the data flow by using the atleast two active PWs.

Before the processor 720 is configured to forward the data flow to thePW trunk interface, the processor 720 is further configured to createthe PW trunk interface, associate the PW trunk interface with the atleast two PWs, and determine at least two PWs as active PWs from the atleast two PWs.

The first PE device 700 in this embodiment of the present disclosure maybe corresponding to the first PE device in the PW load sharing methodembodiments, and modules and the other operations and/or functions ofthe first PE device 700 are separately used to implement steps andmethods that are implemented by the first PE device in the embodimentscorresponding to FIG. 2a to FIG. 4b . The processor 720 is configured toexecute all operations of the processing unit 604 of the first PE devicein FIG. 6. The receiver 710 is configured to execute all operations ofthe receiving unit 602 of the first PE device in FIG. 6. The transmitter730 is configured to execute all operations of the sending unit 606 ofthe first PE device in FIG. 6. For brevity, details are not describedherein.

In another possible embodiment, the first PE device may be a virtual PEdevice implemented based on a general purpose physical server and aNetwork Functions Virtualization (NFV) technology, and the virtual PEdevice is a virtual router. The virtual PE device may be a virtualmachine that runs a program for providing a PW load sharing function,and the virtual machine is deployed on a hardware device (for example, aphysical server). The virtual machine refers to a complete computersystem that is simulated by using software, that has functions of acomplete hardware system, and that runs in a completely isolatedenvironment. The virtual PE device executes all functions and operationsof the first PE device 700.

In another possible embodiment, the controller shown in FIG. 5b may be avirtual controller implemented based on a general purpose physicalserver and a NFV technology, the virtual controller may be a virtualmachine that runs a program for providing a PW load sharing controlfunction, and the virtual machine is deployed on a hardware device (forexample, a physical server). The virtual machine refers to a completecomputer system that is simulated by using software, that has functionsof a complete hardware system, and that runs in a completely isolatedenvironment. The virtual controller executes all functions andoperations of the controller 1510 shown in FIG. 5 b.

It should be understood that, FIG. 5a , FIG. 5b , FIG. 6, and FIG. 7show only a simplified design of the first PE device and a simplifieddesign of the controller. In actual application, the first PE device mayinclude a random quantity of receivers, transmitters, processors,memories, main control boards, interface boards, switching boards,physical interface cards, and the like, and all first PE devices thatcan implement the present disclosure shall fall within the protectionscope of the present disclosure.

It should be understood that, based on this application, a personskilled in the art can combine optional features, steps, or methods thatare described in the embodiments of this application without creativeefforts, and this belongs to the embodiments disclosed in thisapplication. For brevity, description of different combinations is notrepeatedly provided.

It should be understood that, based on this application, a personskilled in the art can combine optional features, steps, or methods thatare described in the embodiments of this application without creativeefforts, and this belongs to the embodiments disclosed in thisapplication. For brevity, description of different combinations is notrepeatedly provided.

The term “and/or” in this specification describes only an associationrelationship for describing associated objects and represents that threerelationships may exist. For example, A and/or B may represent thefollowing three cases: Only A exists, both A and B exist, and only Bexists. In addition, the character “/” in this specification generallyindicates an “or” relationship between the associated objects.

It should be understood that sequence numbers of the foregoing processesdo not mean execution sequences in various embodiments of the presentdisclosure. The execution sequences of the processes should bedetermined according to functions and internal logic of the processes,and should not be construed as any limitation on the implementationprocesses of the embodiments of the present disclosure.

A person of ordinary skill in the art may be aware that, in combinationwith the examples described in the embodiments disclosed in thisspecification, units and algorithm steps may be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by hardware or softwaredepends on particular applications and design constraint conditions ofthe technical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of the present disclosure.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, reference may bemade to a corresponding process in the foregoing method embodiments, anddetails are not described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, the unit division ismerely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented by using some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected according toactual requirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of the presentdisclosure may be integrated into one processing unit, or each of theunits may exist alone physically, or two or more units are integratedinto one unit.

When the functions are implemented in the form of a software functionalunit and sold or used as an independent product, the functions may bestored in a computer-readable storage medium. Based on such anunderstanding, the technical solutions of the present disclosure may beimplemented in a form of a software product. The software product isstored in a storage medium, and comprises several instructions forinstructing a computer device (which may be a personal computer, aserver, or a network device) to perform all or some of the steps of themethods described in the embodiments of the present disclosure. Theforegoing storage medium comprises any medium that can store programcode, such as a USB flash drive, a removable hard disk, a read-onlymemory (ROM), a random access memory (RAM), a magnetic disk, or anoptical disc.

The foregoing descriptions are merely specific implementations of thepresent disclosure, but are not intended to limit the protection scopeof the present disclosure. Any variation or replacement readily figuredout by a person skilled in the art within the technical scope disclosedin the present disclosure shall fall within the protection scope of thepresent disclosure. Therefore, the protection scope of the presentdisclosure shall be subject to the protection scope of the claims.

What is claimed is:
 1. A pseudo wire (PW) load sharing methodcomprising: receiving, by a first provider edge (PE) device, a data flowfrom a customer edge (CE) device; forwarding the data flow to a PW trunkinterface, wherein the first PE device is separately connected to atleast one second PE device by using at least two PWs, and the PW trunkinterface is associated with at least two active PWs; and performing, bythe first PE device, load sharing on the data flow, and forwarding thedata flow by using the at least two active PWs.
 2. The method of claim1, wherein before forwarding the data flow to the PW trunk interface,the method further comprises: creating, by the first PE device, the PWtrunk interface; associating the PW trunk interface with the at leasttwo PWs; and determining, by the first PE device from the at least twoPWs, at least two PWs as active PWs.
 3. The method of claim 2, whereindetermining, by the first PE device from the at least two PWs, at leasttwo PWs as active PWs comprises: obtaining, by the first PE device, anactive PW quantity parameter, wherein the active PW quantity parameterrepresents a quantity of PWs in an active state, and is a positiveinteger greater than or equal to 2; and determining at least two activePWs from the at least two PWs according to the active PW quantityparameter.
 4. The method of claim 3, wherein determining at least twoactive PWs from the at least two PWs according to the active PW quantityparameter comprises: obtaining, by the first PE device, a priority ofeach PW in the at least two PWs; and determining at least two PWs asactive PWs according to the priority of each PW in the at least two PWsand the active PW quantity parameter.
 5. The method of claim 4, whereindetermining at least two PWs as active PWs according to the priority ofeach PW in the at least two PWs and the active PW quantity parametercomprises: obtaining, by the first PE device, the priority of each PW inthe at least two PWs; and determining, from the at least two PWs, atleast two PWs with higher priority ranks as active PWs according to adescending order of the priorities of the PWs and the active PW quantityparameter, wherein the priority of the PW is used to indicate precedencein using the PW as an active PW.
 6. The method of claim 3, whereindetermining at least two active PWs from the at least two PWs accordingto the active PW quantity parameter comprises: obtaining, by the firstPE device, an internet protocol (IP) address of a peer second PE of eachPW in the at least two PWs; and determining at least two PWs as activePWs according to the IP address of the peer second PE of each PW in theat least two PWs and the active PW quantity parameter.
 7. The method ofclaim 6, wherein determining at least two PWs as active PWs according tothe IP address of the peer second PE of each PW in the at least two PWsand the active PW quantity parameter comprises: obtaining, by the firstPE device, the IP address of the peer second PE of each PW in the atleast two PWs; and determining, from the at least two PWs, at least twoPWs with higher IP address ranks as active PWs according to an order ofthe IP addresses of the peer second PEs of the PWs and the active PWquantity parameter.
 8. The method of claim 3, wherein determining atleast two active PWs from the at least two PWs according to the activePW quantity parameter comprises: obtaining, by the first PE device, apriority of each PW in the at least two PWs and an IP address of a peersecond PE of each PW in the at least two PWs; and determining at leasttwo PWs as active PWs according to the priority of each PW in the atleast two PWs, the IP address of the peer second PE of each PW in the atleast two PWs, and the active PW quantity parameter.
 9. The method ofclaim 1, wherein receiving, by the first PE device, a data flow from aCE device, comprises receiving, by the first PE device, the data flowfrom the CE device through an attachment circuit (AC) interface, andwherein forwarding the data flow to a PW trunk interface comprisesforwarding the data flow to the PW trunk interface according to anassociation relationship between the AC interface and the PW trunkinterface.
 10. A first provider edge PE device separately connected toat least one second PE device by using at least two PWs, the first PEdevice comprising: a non-transitory memory comprising instructions; areceiver configured to receive a data flow from a customer edge CEdevice; a processor in communication with the non-transitory memory,wherein the instructions cause the processor to: forward the data flowto a PW trunk interface, wherein the PW trunk interface is associatedwith at least two active PWs; and perform load sharing processing on thedata flow; and a transmitter configured to forward the data flow byusing the at least two active PWs.
 11. The first PE device of claim 10,wherein before the processor forwards the data flow to the PW trunkinterface, the instructions further cause the processor to: create thePW trunk interface; associate the PW trunk interface with the at leasttwo PWs; and determine, from the at least two PWs, at least two PWs asactive PWs.
 12. The first PE device of claim 11, wherein theinstructions further cause the processor to: obtain an active PWquantity parameter, wherein the active PW quantity parameter representsa quantity of PWs in an active state, and is a positive integer greaterthan or equal to 2; and determine the at least two active PWs from theat least two PWs according to the active PW quantity parameter.
 13. Thefirst PE device of claim 12, wherein the instructions further cause theprocessor to: obtain a priority of each PW in the at least two PWs; anddetermine the at least two PWs as active PWs according to the priorityof each PW in the at least two PWs and the active PW quantity parameter.14. The first PE device of claim 13, wherein the instructions furthercause the processor to: obtain the priority of each PW in the at leasttwo PWs; and determine, from the at least two PWs, at least two PWs withhigher priority ranks as the active PWs according to an order of thepriorities of the PWs and the active PW quantity parameter, wherein thepriority of the PW is used to indicate precedence in using the PW as anactive PW.
 15. The first PE device of claim 12, wherein the instructionsfurther cause the processor to: obtain an IP address of a peer second PEof each PW in the at least two PWs; and determine at least two PWs asthe active PWs according to the internet protocol (IP) address of thepeer second PE of each PW in the at least two PWs and the active PWquantity parameter.
 16. The first PE device of claim 15, wherein theinstructions further cause the processor to: obtain the IP address ofthe peer second PE of each PW in the at least two PWs; and determine,from the at least two PWs, at least two PWs with higher IP address ranksas the active PWs according to an order of the IP addresses of the peersecond PEs of the PWs and the active PW quantity parameter.
 17. Thefirst PE device of claim 12, wherein the instructions further cause theprocessor to: obtain a priority of each PW in the at least two PWs andan IP address of a peer second PE of each PW in the at least two PWs;and determine at least two PWs as active PWs according to the priorityof each PW in the at least two PWs, the IP address of the peer second PEof each PW in the at least two PWs, and the active PW quantityparameter.
 18. The first PE device of claim 10, wherein the receiver isconfigured to receive the data flow from the CE device through anattachment circuit (AC) interface, and wherein the instructions furthercause the processor to: forward the data flow to the PW trunk interfaceaccording to an association relationship between the AC interface andthe PW trunk interface; and store the association relationship betweenthe AC interface and the PW trunk interface.
 19. The first PE device ofclaim 10, wherein the receiver is configured to receive the data flowfrom the CE device through an attachment circuit (AC) interface, andwherein the instructions further cause the processor to: forward thedata flow to a virtual switch instance (VSI); search a media accesscontrol (MAC) forwarding table in the VSI to obtain the PW trunkinterface; forward the data flow to the PW trunk interface, wherein theMAC forwarding table comprises an association relationship between adestination MAC address and the PW trunk interface, and the data flowcomprises the destination MAC address; and store the MAC forwardingtable.
 20. A non-transitory computer readable storage medium comprisinginstructions that when executed by a first provider edge PE deviceseparately connected to at least one second PE device by using at leasttwo PWs cause the first PE device to: receive a data flow from acustomer edge CE device; forward the data flow to a PW trunk interface,wherein the PW trunk interface is associated with at least two activePWs; perform load sharing processing on the data flow; and forward thedata flow by using the at least two active PWs.